import { defineComponent } from "vue";
import { useRouter } from "vue-router";
import appConfig from '../../public/app-config.json'

export default defineComponent({
    name: "GlobalHeader",
    setup(){
        const router = useRouter();
        const nav = [{
            label: '关于',
            route: '/about'
        }];
        return{ router,nav }
    },
    render(){
        return <div class="w-full h-full border-b shadow-lg flex justify-between items-center px-5">
            <h1 class="text-xl font-semibold cursor-pointer" onClick={()=>this.router.push('/')}>{appConfig.company}<span class="text-red-500">{appConfig.recruitType}</span></h1>
            <div>
                {this.nav.map(item=><span onClick={()=>this.router.push(item.route)} class="ml-3 cursor-pointer text-gray-500 font-normal">{item.label}</span>)}
            </div>
        </div>
    }
})